package com.ruoyi.app.controller.member.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.member.MemberVipTypeDO;
import com.ruoyi.common.entity.VO.member.MemberVipTypeVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IMemberVipTypeMapper extends BaseMapper<MemberVipTypeDO> {

    @Select("SELECT id,vip_type_name vipTypeName,vip_type_logo vipTypeLogo,upgrade_condition upgradeCondition,upgrade_value upgradeValue FROM member_vip_type WHERE is_enable=1 and is_delete=0 and upgrade_Value >(select upgrade_Value from member_vip_type where id=#{vipTypeId}) order by upgrade_value asc LIMIT 1")
    MemberVipTypeDO getNextVipTypeInfo(Long vipTypeId);

    @Select("SELECT id,vip_type_name vipTypeName,vip_type_logo vipTypeLogo,upgrade_condition upgradeCondition,upgrade_value upgradeValue,order_num orderNum FROM member_vip_type WHERE is_enable=1 and is_delete=0 order by upgrade_value desc")
    List<MemberVipTypeDO> searchVipTypeList();

    @Select("SELECT id,vip_type_name vipTypeName,vip_type_logo vipTypeLogo,order_num orderNum,upgrade_condition upgradeCondition,upgrade_value upgradeValue FROM member_vip_type WHERE is_enable=1 and is_delete=0 order by upgrade_value asc")
    List<MemberVipTypeVO> searchVipTypeForBenefitList();
}
